package interfazAWT;



import java.awt.BorderLayout;
import java.awt.Button;
import java.awt.Choice;
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.GridLayout;
import java.awt.Image;
import java.awt.Label;
import java.awt.Menu;
import java.awt.MenuBar;
import java.awt.MenuItem;
import java.awt.Panel;
import java.awt.TextArea;
import java.awt.TextField;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.imageio.ImageIO;
import javax.swing.JOptionPane;


/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author djdracku
 */
public class Ventana {
  
    TextArea are;
    final Frame f=new Frame();

   

    final TextArea ar=new TextArea();
    final TextField t1=new TextField();
        Button b2=new Button("Guargar");
         public void visible() {
        b2.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
 
        JOptionPane.showMessageDialog(f,"GUARDADO");
        TestPaint p=new TestPaint();
        p.visible();
        f.dispose();
  

            }
        });
        Button b12=new Button("Cancelar");

        b12.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {

            Paint p=new Paint();
            p.visible();
            f.dispose();

            }
        });
        Panel p6 = new Panel();


        Panel p1 = new Panel();
        p1.setLayout(new GridLayout(2,1));
        Panel p5 = new Panel();
        p5.setLayout(new FlowLayout());
        p6.setLayout(new GridLayout(2, 1));
        p6.add(p1);
        p6.add(p5);


        Panel p2 = new Panel();
        p2.setLayout(new GridLayout(2, 1));
        Panel p3 = new Panel();
        p3.setLayout(new GridLayout(4, 1));
        Panel p4 = new Panel();
        p4.setLayout(new GridLayout(5, 1));
        p2.add(p3);
        p2.add(p4);


        
        f.addWindowListener(new WindowAdapter() {

         public void windowClosing(WindowEvent e) {
                System.exit(0);
            }


        });

        Button b3=new Button("  "){
         public void paint(Graphics g){
                Image img =null;
                try{
                    img=javax.imageio.ImageIO.read(new File("imagenes/estrella.jpg"));
                }catch(IOException e){
                e.printStackTrace();
            }
                g.drawImage(img, 2, 1,this);
            }


            };
        Label l1=new Label("Favoritos");
        p3.add(b3);
        p3.add(l1);
        Button b4=new Button("  "){
         public void paint(Graphics g){
                Image img =null;
                try{
                    img=javax.imageio.ImageIO.read(new File("imagenes/Escritorio.jpg"));
                }catch(IOException e){
                e.printStackTrace();
            }
                g.drawImage(img, 2, 1,this);
            }


            };
        Label l2=new Label("Escritorio");
        p3.add(b4);
        p3.add(l2);
        Button b5=new Button("  "){
         public void paint(Graphics g){
                Image img =null;
                try{
                    img=javax.imageio.ImageIO.read(new File("imagenes/SitiosRecientes.PNG"));
                }catch(IOException e){
                e.printStackTrace();
            }
                g.drawImage(img, 2, 1,this);
            }


            };
        Label l3=new Label("Sitios recientes");
        p3.add(b5);
        p3.add(l3);
        Button b6=new Button("  "){
         public void paint(Graphics g){
                Image img =null;
                try{
                    img=javax.imageio.ImageIO.read(new File("imagenes/Descarga.jpg"));
                }catch(IOException e){
                e.printStackTrace();
            }
                g.drawImage(img, 2, 1,this);
            }


            };
        Label l4=new Label("Descargas");
        p3.add(b6);
        p3.add(l4);


        Button b7=new Button("  "){
         public void paint(Graphics g){
                Image img =null;
                try{
                    img=javax.imageio.ImageIO.read(new File("imagenes/Biblioteca.jpg"));
                }catch(IOException e){
                e.printStackTrace();
            }
                g.drawImage(img, 2, 1,this);
            }


            };
        Label l5=new Label("Bibliotecas");
        p4.add(b7);
        p4.add(l5);
        Button b8=new Button("  "){
         public void paint(Graphics g){
                Image img =null;
                try{
                    img=javax.imageio.ImageIO.read(new File("imagenes/Documentos.jpg"));
                }catch(IOException e){
                e.printStackTrace();
            }
                g.drawImage(img, 2, 1,this);
            }


            };
        Label l6=new Label("Documentos");
        p4.add(b8);
        p4.add(l6);
        Button b9=new Button("  "){
         public void paint(Graphics g){
                Image img =null;
                try{
                    img=javax.imageio.ImageIO.read(new File("imagenes/Imagenes.jpg"));
                }catch(IOException e){
                e.printStackTrace();
            }
                g.drawImage(img, 2, 1,this);
            }


            };
        Label l7=new Label("Imagenes");
        p4.add(b9);
        p4.add(l7);
        Button b10=new Button("  "){
         public void paint(Graphics g){
                Image img =null;
                try{
                    img=javax.imageio.ImageIO.read(new File("imagenes/musica.jpg"));
                }catch(IOException e){
                e.printStackTrace();
            }
                g.drawImage(img, 2, 1,this);
            }


            };
        Label l8=new Label("Musica");
        p4.add(b10);
        p4.add(l8);
        Button b11=new Button("  "){
         public void paint(Graphics g){
                Image img =null;
                try{
                    img=javax.imageio.ImageIO.read(new File("imagenes/Video.jpg"));
                }catch(IOException e){
                e.printStackTrace();
            }
                g.drawImage(img, 2, 1,this);
            }


            };
        Label l9=new Label("Videos");
        p4.add(b11);
        p4.add(l9);


        f.add(ar);

        Label l10=new Label("                                                                       Nombre:");
        p1.add(l10);
        TextField t=new TextField("  ");
        p1.add(t);
        Label l11=new Label("                                                                       Tipo:");
        p1.add(l11);
        Choice c=new Choice();
        String a[]={"PNG(*.png)","JPEG(*.jpg;.*jpeg;*.jpe;*.jfif)","GIF(*.gif)"};
        int o=0;
        for(o=0;o<3;o++){
         c.addItem(a[o]);
        }
        p1.add(c);

        Panel p13 = new Panel();

     
        p5.add(b2);
        p5.add(b12);
        f.add(p2, BorderLayout.WEST);

        f.add(p6, BorderLayout.SOUTH);

        f.setSize(600, 400);
        f.setVisible(true);
    }
       public static void main(String args[]){
       Ventana v=new Ventana();
       v.visible();


}
}
